<!-- 验光表 -->
<template>
  <div>
    <el-form :model="optometryData" :rules="dataRule" ref="dataForm">
    <!--验光处方类型(1-远用,2-近用,3-隐形,4-渐进/双光,5-中用,6-角膜塑形镜,7-视觉训练,8-角膜塑形镜VST,9-角膜塑形镜CRT,10-RGP,11-药水)-->
    <!-- 远用 -->
    <table v-if="saleType == 4 && (!optometryData.optType || optometryData.optType == 1)" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-90">远用</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>三棱镜</th>
        <th>基底</th>
        <th>远用瞳距(mm)</th>
        <th>瞳高(mm)</th>
        <th>远用VA</th>
        <th>倾斜角</th>
        <th>镜眼距</th>
        <th>镜面角</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.arriseGlassOd"></el-input>
        </td>
        <td>
          <el-select class="table-select" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.basisOd">
            <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
          </el-select>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOd">
            <el-input class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.farPupilDistanceOd" @change="valueJudge('farPupilDistanceOd')"></el-input>
          </el-form-item>
          </td>
        <td>
          <el-input class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.pupilHighOd" @change="valueJudge('pupilHighOd')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.farUseOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.tiltAngleOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.lensEyeDistanceOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.mirrorAngleOd"></el-input>
        </td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.arriseGlassOs"></el-input></td>
        <td>
          <el-select class="table-select" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.basisOs">
            <el-option v-for="item in bizData.basalTypeData" :value="item.value" :label="item.label" :key="item.value"></el-option>
          </el-select>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOs">
            <el-input class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.farPupilDistanceOs" @change="valueJudge('farPupilDistanceOs')"></el-input>
          </el-form-item>
          </td>
        <td>
          <el-input class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.pupilHighOs" @change="valueJudge('pupilHighOs')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.farUseOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.tiltAngleOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.lensEyeDistanceOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.mirrorAngleOs"></el-input>
        </td>
      </tr>
      <tr>
        <td colspan="2">脸宽(mm)</td>
        <td colspan="4" class="colspan-td">
          <el-input class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.faceWidth"></el-input>
        </td>
        <td colspan="2" class="colspan-td">镜腿弯脚位(mm)</td>
        <td colspan="4" class="colspan-td">
          <el-input class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.cornerPosition"></el-input>
        </td>
      </tr>
      <template>
        <tr v-if="source == 'sale'">
          <td colspan="4" class="colspan-td">建议镜片材质:{{optometryData.suggestMaterial}}</td>
          <td colspan="4" class="colspan-td">处理方式:{{optometryData.handleMethod}}</td>
          <td colspan="4" class="colspan-td">建议镜框:{{optometryData.suggestGlass}}</td>
        </tr>
        <tr v-if="source == 'register'">
            <td colspan="4" class="colspan-td">
              <el-form label-width="120px">
              <el-form-item label="建议镜片材质">
                <el-input size="mini" class="table-input" v-model="optometryData.suggestMaterial"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="处理方式">
                <el-input size="mini" class="table-input" v-model="optometryData.handleMethod"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="建议镜框">
                <el-input size="mini" class="table-input" v-model="optometryData.suggestGlass"></el-input>
              </el-form-item>
              </el-form>
            </td>
        </tr>
      </template>
      <tr>
        <td colspan="2">备注</td>
        <td colspan="10">
          <el-input type="textarea" :rows="1" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.memo"></el-input>
        </td>
      </tr>
      <tr>
        <th colspan="2"></th>
        <th colspan="2">旧瞳距(mm)</th>
        <th>片高(mm)</th>
        <th>片宽(mm)</th>
        <th>中梁(mm)</th>
        <th colspan="2">镜片通道(mm)</th>
        <th>对角线(mm)</th>
        <th>框型</th>
        <th>直径(mm)</th>
      </tr>
      <tr>
        <td colspan="2">手动填写</td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput25" @keyup.native.enter="nextInput(26)" v-model="optometryData.oldPupilDistance"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput26" @keyup.native.enter="nextInput(27)" v-model="optometryData.chipHeight"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput27" @keyup.native.enter="nextInput(28)" v-model="optometryData.chipWidth"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput28" @keyup.native.enter="nextInput(29)" v-model="optometryData.centreSill"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput29" @keyup.native.enter="nextInput(30)" v-model="optometryData.glassesChannel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput30" @keyup.native.enter="nextInput(31)" v-model="optometryData.diagonal"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput31" @keyup.native.enter="nextInput(32)" v-model="optometryData.frameModel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput32" @keyup.native.enter="nextInput(33)" v-model="optometryData.diameter"></el-input>
        </td>
      </tr>
    </table>
    <!-- 近用 -->
    <table v-if="optometryData.optType == 2" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-90">近用</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>三棱镜</th>
        <th>基底</th>
        <th>近用瞳距(mm)</th>
        <th>瞳高(mm)</th>
        <th>近用VA</th>
        <th>倾斜角</th>
        <th>镜眼距</th>
        <th>镜面角</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.arriseGlassOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.basisOd"></el-input>
        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOd">
            <el-input class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.nearPupilDistanceOd" @change="valueJudge('nearPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.pupilHighOd" @change="valueJudge('pupilHighOd')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.nearUseOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.tiltAngleOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.lensEyeDistanceOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.mirrorAngleOd"></el-input>
        </td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.arriseGlassOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.basisOs"></el-input>
        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOs">
            <el-input class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.nearPupilDistanceOs" @change="valueJudge('nearPupilDistanceOs')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.pupilHighOs" @change="valueJudge('pupilHighOs')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.nearUseOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.tiltAngleOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.lensEyeDistanceOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.mirrorAngleOs"></el-input>
        </td>
      </tr>
      <tr>
        <td colspan="2">脸宽(mm)</td>
        <td colspan="4" class="colspan-td">
          <el-input class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.faceWidth"></el-input>
        </td>
        <td colspan="2" class="colspan-td">镜腿弯脚位(mm)</td>
        <td colspan="4" class="colspan-td">
          <el-input class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.cornerPosition"></el-input>
        </td>
      </tr>
      <template>
        <tr v-if="source == 'sale'">
          <td colspan="4" class="colspan-td">建议镜片材质:{{optometryData.suggestMaterial}}</td>
          <td colspan="4" class="colspan-td">处理方式:{{optometryData.handleMethod}}</td>
          <td colspan="4" class="colspan-td">建议镜框:{{optometryData.suggestGlass}}</td>
        </tr>
        <tr v-if="source == 'register'">
            <td colspan="4" class="colspan-td">
              <el-form label-width="120px">
              <el-form-item label="建议镜片材质">
                <el-input class="table-input" v-model="optometryData.suggestMaterial"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="处理方式">
                <el-input class="table-input" v-model="optometryData.handleMethod"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="建议镜框">
                <el-input class="table-input" v-model="optometryData.suggestGlass"></el-input>
              </el-form-item>
              </el-form>
            </td>
        </tr>
      </template>
      <tr>
        <td colspan="2">备注</td>
        <td colspan="10">
          <el-input type="textarea" :rows="1" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.memo"></el-input>
        </td>
      </tr>
      <tr>
        <th colspan="2"></th>
        <th colspan="2">旧瞳距(mm)</th>
        <th>片高(mm)</th>
        <th>片宽(mm)</th>
        <th>中梁(mm)</th>
        <th colspan="2">镜片通道(mm)</th>
        <th>对角线(mm)</th>
        <th>框型</th>
        <th>直径(mm)</th>
      </tr>
      <tr>
        <td colspan="2">手动填写</td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput25" @keyup.native.enter="nextInput(26)" v-model="optometryData.oldPupilDistance"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput26" @keyup.native.enter="nextInput(27)" v-model="optometryData.chipHeight"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput27" @keyup.native.enter="nextInput(28)" v-model="optometryData.chipWidth"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput28" @keyup.native.enter="nextInput(29)" v-model="optometryData.centreSill"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput29" @keyup.native.enter="nextInput(30)" v-model="optometryData.glassesChannel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput30" @keyup.native.enter="nextInput(31)" v-model="optometryData.diagonal"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput31" @keyup.native.enter="nextInput(32)" v-model="optometryData.frameModel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput32" @keyup.native.enter="nextInput(33)" v-model="optometryData.diameter"></el-input>
        </td>
      </tr>
    </table>
    <!-- 渐进/双光 -->
    <table v-if="optometryData.optType == 4" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-90">双光/渐进</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>Add</th>
        <th>三棱镜</th>
        <th>基底</th>
        <th>远用瞳距(mm)</th>
        <th>近用瞳距(mm)</th>
        <th>瞳高(mm)</th>
        <th>远用VA</th>
        <th>近用VA</th>
        <th>倾斜角</th>
        <th>镜眼距</th>
        <th>镜面角</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.addOd" @change="valueJudge('addOd')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.arriseGlassOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.basisOd"></el-input>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOd">
            <el-input class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.farPupilDistanceOd" @change="valueJudge('farPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOd">
            <el-input class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.nearPupilDistanceOd" @change="valueJudge('nearPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.pupilHighOd" @change="valueJudge('pupilHighOd')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.farUseOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.nearUseOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.tiltAngleOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.lensEyeDistanceOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.mirrorAngleOd"></el-input>
        </td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.addOs" @change="valueJudge('addOs')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.arriseGlassOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.basisOs"></el-input>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOs">
            <el-input class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.farPupilDistanceOs" @change="valueJudge('farPupilDistanceOs')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOs">
            <el-input class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.nearPupilDistanceOs" @change="valueJudge('nearPupilDistanceOs')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.pupilHighOs" @change="valueJudge('pupilHighOs')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.farUseOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.nearUseOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput25" @keyup.native.enter="nextInput(26)" v-model="optometryData.tiltAngleOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput26" @keyup.native.enter="nextInput(27)" v-model="optometryData.lensEyeDistanceOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput27" @keyup.native.enter="nextInput(28)" v-model="optometryData.mirrorAngleOs"></el-input>
        </td>
      </tr>
      <tr>
        <td>脸宽(mm)</td>
        <td colspan="6" class="colspan-td">
          <el-input class="table-input" ref="tableInput28" @keyup.native.enter="nextInput(29)" v-model="optometryData.faceWidth"></el-input>
        </td>
        <td colspan="2" class="colspan-td">镜腿弯脚位(mm)</td>
        <td colspan="6" class="colspan-td">
          <el-input class="table-input" ref="tableInput29" @keyup.native.enter="nextInput(30)" v-model="optometryData.cornerPosition"></el-input>
        </td>
      </tr>
      <template>
        <tr v-if="source == 'sale'">
          <td colspan="5" class="colspan-td">建议镜片材质:{{optometryData.suggestMaterial}}</td>
          <td colspan="5" class="colspan-td">处理方式:{{optometryData.handleMethod}}</td>
          <td colspan="5" class="colspan-td">建议镜框:{{optometryData.suggestGlass}}</td>
        </tr>
        <tr v-if="source == 'register'">
            <td colspan="5" class="colspan-td">
              <el-form label-width="120px">
              <el-form-item label="建议镜片材质">
                <el-input class="table-input" v-model="optometryData.suggestMaterial"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="5" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="处理方式">
                <el-input class="table-input" v-model="optometryData.handleMethod"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="5" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="建议镜框">
                <el-input class="table-input" v-model="optometryData.suggestGlass"></el-input>
              </el-form-item>
              </el-form>
            </td>
        </tr>
      </template>
      <tr>
        <td>备注</td>
        <td colspan="14">
          <el-input type="textarea" :rows="1" ref="tableInput30" @keyup.native.enter="nextInput(31)" v-model="optometryData.memo"></el-input>
        </td>
      </tr>
      <tr>
        <th></th>
        <th colspan="2">旧瞳距(mm)</th>
        <th>片高(mm)</th>
        <th>片宽(mm)</th>
        <th>中梁(mm)</th>
        <th colspan="2">镜片通道(mm)</th>
        <th colspan="2">对角线(mm)</th>
        <th>框型</th>
        <th>直径(mm)</th>
        <th>立线</th>
        <th>面弯</th>
        <th>前倾角</th>
      </tr>
      <tr>
        <td>手动填写</td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput31" @keyup.native.enter="nextInput(32)" v-model="optometryData.oldPupilDistance"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput32" @keyup.native.enter="nextInput(33)" v-model="optometryData.chipHeight"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput33" @keyup.native.enter="nextInput(34)" v-model="optometryData.chipWidth"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput34" @keyup.native.enter="nextInput(35)" v-model="optometryData.centreSill"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput35" @keyup.native.enter="nextInput(36)" v-model="optometryData.glassesChannel"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput36" @keyup.native.enter="nextInput(37)" v-model="optometryData.diagonal"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput37" @keyup.native.enter="nextInput(38)" v-model="optometryData.frameModel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput38" @keyup.native.enter="nextInput(39)" v-model="optometryData.diameter"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput39" @keyup.native.enter="nextInput(40)" v-model="optometryData.verticalLine"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput40" @keyup.native.enter="nextInput(41)" v-model="optometryData.faceBending"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput41" @keyup.native.enter="nextInput(42)" v-model="optometryData.frontRake"></el-input>
        </td>
      </tr>
    </table>
    <!-- 中用 -->
    <table v-if="optometryData.optType == 5" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-90">中用</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>三棱镜</th>
        <th>基底</th>
        <th>中用瞳距(mm)</th>
        <th>瞳高(mm)</th>
        <th>中用VA</th>
        <th>倾斜角</th>
        <th>镜眼距</th>
        <th>镜面角</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.arriseGlassOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.basisOd"></el-input>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOd">
            <el-input class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.farPupilDistanceOd" @change="valueJudge('farPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.pupilHighOd" @change="valueJudge('pupilHighOd')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.farUseOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.tiltAngleOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.lensEyeDistanceOd"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.mirrorAngleOd"></el-input>
        </td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.arriseGlassOs"></el-input>
          </td>
        <td>
          <el-input class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.basisOs"></el-input>
        </td>
        <td>
          <el-form-item prop="farPupilDistanceOs">
            <el-input class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.farPupilDistanceOs" @change="valueJudge('farPupilDistanceOs')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.pupilHighOs" @change="valueJudge('pupilHighOs')"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.farUseOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.tiltAngleOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.lensEyeDistanceOs"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.mirrorAngleOs"></el-input>
        </td>
      </tr>
      <tr>
        <td>脸宽(mm)</td>
        <td colspan="4" class="colspan-td"><el-input size="mini" class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.faceWidth"></el-input></td>
        <td colspan="2" class="colspan-td">镜腿弯脚位(mm)</td>
        <td colspan="5" class="colspan-td"><el-input size="mini" class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.cornerPosition"></el-input></td>
      </tr>
      <template>
        <tr v-if="source == 'sale'">
          <td colspan="4" class="colspan-td">建议镜片材质:{{optometryData.suggestMaterial}}</td>
          <td colspan="4" class="colspan-td">处理方式:{{optometryData.handleMethod}}</td>
          <td colspan="4" class="colspan-td">建议镜框:{{optometryData.suggestGlass}}</td>
        </tr>
        <tr v-if="source == 'register'">
            <td colspan="4" class="colspan-td">
              <el-form label-width="120px">
              <el-form-item label="建议镜片材质">
                <el-input size="mini" class="table-input" v-model="optometryData.suggestMaterial"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="处理方式">
                <el-input size="mini" class="table-input" v-model="optometryData.handleMethod"></el-input>
              </el-form-item>
              </el-form>
            </td>
            <td colspan="4" class="colspan-td">
              <el-form label-width="80px">
              <el-form-item label="建议镜框">
                <el-input size="mini" class="table-input" v-model="optometryData.suggestGlass"></el-input>
              </el-form-item>
              </el-form>
            </td>
        </tr>
      </template>
      <tr>
        <td>备注</td>
        <td colspan="11"><el-input size="mini" type="textarea" :rows="1" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.memo"></el-input></td>
      </tr>
      <tr>
        <th></th>
        <th colspan="2">旧瞳距(mm)</th>
        <th>片高(mm)</th>
        <th>片宽(mm)</th>
        <th>中梁(mm)</th>
        <th colspan="2">镜片通道(mm)</th>
        <th colspan="2">对角线(mm)</th>
        <th>框型</th>
        <th>直径(mm)</th>
      </tr>
      <tr>
        <td>手动填写</td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput25" @keyup.native.enter="nextInput(26)" v-model="optometryData.oldPupilDistance"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput26" @keyup.native.enter="nextInput(27)" v-model="optometryData.chipHeight"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput27" @keyup.native.enter="nextInput(28)" v-model="optometryData.chipWidth"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput28" @keyup.native.enter="nextInput(29)" v-model="optometryData.centreSill"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput29" @keyup.native.enter="nextInput(30)" v-model="optometryData.glassesChannel"></el-input>
        </td>
        <td colspan="2">
          <el-input class="table-input" ref="tableInput30" @keyup.native.enter="nextInput(31)" v-model="optometryData.diagonal"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput31" @keyup.native.enter="nextInput(32)" v-model="optometryData.frameModel"></el-input>
        </td>
        <td>
          <el-input class="table-input" ref="tableInput32" @keyup.native.enter="nextInput(33)" v-model="optometryData.diameter"></el-input>
        </td>
      </tr>
    </table>
    <!-- 隐形 -->
    <table v-if="optometryData.optType == 3" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145">隐形</th>
        <th>BC</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>曲率</th>
        <th>直径</th>
        <th>隐形VA</th>
        <th>适用镜片</th>
        <th>片/盒数</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td><el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.bcOd"></el-input></td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.curvatureOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.diameterOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.invisibleOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.suitableGlassOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.numberBoxOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td><el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.bcOs"></el-input></td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.curvatureOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.diameterOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.invisibleOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.suitableGlassOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.numberBoxOs"></el-input></td>
      </tr>
      <template>
        <tr v-if="source == 'sale'">
          <td colspan="9" class="colspan-td">建议护理液:{{optometryData.suggestMaterial}}</td>
        </tr>
        <tr v-if="source == 'register'">
            <td colspan="9" class="colspan-td">
              <el-form label-width="120px">
              <el-form-item label="建议护理液">
                <el-input size="mini" class="table-input" v-model="optometryData.suggestMaterial"></el-input>
              </el-form-item>
              </el-form>
            </td>
        </tr>
      </template>
      <tr>
        <td>备注</td>
        <td colspan="9"><el-input size="mini" type="textarea" :rows="1" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.memo"></el-input></td>
      </tr>
    </table>
    <!-- 角膜塑形镜 -->
    <table v-if="optometryData.optType == 6" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145" style="width: 60px;">角膜塑形镜</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>平K</th>
        <th>陡K</th>
        <th>e值</th>
        <th>角膜直径</th>
        <th>试戴片K</th>
        <th>K1</th>
        <th>K2</th>
        <th>光度</th>
        <th>降幅</th>
        <th>直径</th>
        <th>适用镜片</th>
        <th>片/盒数</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.smoothKOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.steepKOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.valueEOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.cornealDiameterOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.tryKOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.k1Od"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.k2Od"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.luminosityOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.declineOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.diameterOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.suitableGlassOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.numberBoxOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input size="mini" class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.smoothKOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.steepKOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.valueEOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.cornealDiameterOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.tryKOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.k1Os"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.k2Os"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput25" @keyup.native.enter="nextInput(26)" v-model="optometryData.luminosityOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput26" @keyup.native.enter="nextInput(27)" v-model="optometryData.declineOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput27" @keyup.native.enter="nextInput(28)" v-model="optometryData.diameterOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput28" @keyup.native.enter="nextInput(29)" v-model="optometryData.suitableGlassOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput29" @keyup.native.enter="nextInput(30)" v-model="optometryData.numberBoxOs"></el-input></td>
      </tr>
    </table>
    <!-- 视觉训练 -->
    <table v-if="optometryData.optType == 7" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145">视觉训练</th>
        <th>球镜</th>
        <th>柱镜</th>
        <th>轴向</th>
        <th>三棱镜</th>
        <th>基底</th>
        <th>远用瞳距(mm)</th>
        <th>近用瞳距(mm)</th>
        <th>远用VA</th>
        <th>近用VA</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td>
          <el-form-item prop="ballGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.ballGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOd">
            <el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.postGlassOd"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOd">
            <el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.axesOd" @change="axesOdChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.arriseGlassOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.basisOd"></el-input></td>
        <td>
          <el-form-item prop="farPupilDistanceOd">
            <el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.farPupilDistanceOd" @change="valueJudge('farPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOd">
            <el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.nearPupilDistanceOd" @change="valueJudge('nearPupilDistanceOd')"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.farUseOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.nearUseOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td>
          <el-form-item prop="ballGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.ballGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="postGlassOs">
            <el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.postGlassOs"></el-input>
          </el-form-item>
        </td>
        <td>
          <el-form-item prop="axesOs">
            <el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.axesOs" @change="axesOsChange"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.arriseGlassOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.basisOs"></el-input></td>
        <td>
          <el-form-item prop="farPupilDistanceOs">
            <el-input size="mini" class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.farPupilDistanceOs" @change="valueJudge('farPupilDistanceOs')"></el-input>
          </el-form-item>

        </td>
        <td>
          <el-form-item prop="nearPupilDistanceOs">
            <el-input size="mini" class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.nearPupilDistanceOs" @change="valueJudge('nearPupilDistanceOs')"></el-input>
          </el-form-item>
        </td>
        <td><el-input size="mini" class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.farUseOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.nearUseOs"></el-input></td>
      </tr>
    </table>
    <!-- 角膜塑形镜VST -->
    <table v-if="optometryData.optType == 8" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145">角膜塑形镜VST</th>

        <th>试戴片编号</th>
        <th>FK</th>
        <th>曲率半径</th>
        <th>AC</th>
        <th>降幅</th>
        <th>DIA</th>
        <th>BC</th>
        <th>CP/CLY</th>
        <th>e值</th>
        <th>VA</th>
        <th>镜片颜色</th>
        <th>品牌</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td><el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.tryNumberOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.fkOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.curvatureRadiusOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.acOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.declineOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.diaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.bcOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.cpClyOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.valueEOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.vaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.glassColorOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.brandOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td><el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.tryNumberOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.fkOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.curvatureRadiusOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.acOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.declineOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.diaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.bcOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.cpClyOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.valueEOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.vaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.glassColorOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput23" @keyup.native.enter="nextInput(24)" v-model="optometryData.brandOs"></el-input></td>
      </tr>
      <tr>
        <td>备注</td>
        <td colspan="9"><el-input size="mini" type="textarea" :rows="1" ref="tableInput24" @keyup.native.enter="nextInput(25)" v-model="optometryData.memo"></el-input></td>
      </tr>
    </table>
    <!-- 角膜塑形镜CRT -->
    <table v-if="optometryData.optType == 9" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145">角膜塑形镜CRT</th>
        <th>试戴片编号</th>
        <th>BC</th>
        <th>RZD</th>
        <th>LZA</th>
        <th>RZD2</th>
        <th>LZA2</th>
        <th>降幅</th>
        <th>DIA</th>
        <th>VA</th>
        <th>镜片颜色</th>
        <th>品牌</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td><el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.tryNumberOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.bcOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.rzdOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.lzaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.rzdOd2"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.lzaOd2"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.declineOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.diaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.vaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.glassColorOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.brandOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td><el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.tryNumberOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.bcOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.rzdOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.lzaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput15" @keyup.native.enter="nextInput(16)" v-model="optometryData.rzdOs2"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput16" @keyup.native.enter="nextInput(17)" v-model="optometryData.lzaOs2"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput17" @keyup.native.enter="nextInput(18)" v-model="optometryData.declineOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput18" @keyup.native.enter="nextInput(19)" v-model="optometryData.diaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput19" @keyup.native.enter="nextInput(20)" v-model="optometryData.vaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput20" @keyup.native.enter="nextInput(21)" v-model="optometryData.glassColorOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput21" @keyup.native.enter="nextInput(22)" v-model="optometryData.brandOs"></el-input></td>
      </tr>
      <tr>
        <td class="width-145">备注</td>
        <td colspan="9"><el-input size="mini" type="textarea" :rows="1" ref="tableInput22" @keyup.native.enter="nextInput(23)" v-model="optometryData.memo"></el-input></td>
      </tr>
    </table>
    <!-- RGP -->
    <table v-if="optometryData.optType == 10" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <th class="width-145">RGP</th>

        <th>屈光度</th>
        <th>BC</th>
        <th>DIA</th>
        <th>散光</th>
        <th>镜片颜色</th>
        <th>特殊设计</th>
        <th>品牌</th>
      </tr>
      <tr style="text-align: center;">
        <td>OD</td>
        <td><el-input size="mini" class="table-input" ref="tableInput0" @keyup.native.enter="nextInput(1)" v-model="optometryData.diopterOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput1" @keyup.native.enter="nextInput(2)" v-model="optometryData.bcOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput2" @keyup.native.enter="nextInput(3)" v-model="optometryData.diaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput3" @keyup.native.enter="nextInput(4)" v-model="optometryData.astigmiaOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput4" @keyup.native.enter="nextInput(5)" v-model="optometryData.glassColorOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput5" @keyup.native.enter="nextInput(6)" v-model="optometryData.specialDesignOd"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput6" @keyup.native.enter="nextInput(7)" v-model="optometryData.brandOd"></el-input></td>
      </tr>
      <tr>
        <td>OS</td>
        <td><el-input size="mini" class="table-input" ref="tableInput7" @keyup.native.enter="nextInput(8)" v-model="optometryData.diopterOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput8" @keyup.native.enter="nextInput(9)" v-model="optometryData.bcOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput9" @keyup.native.enter="nextInput(10)" v-model="optometryData.diaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput10" @keyup.native.enter="nextInput(11)" v-model="optometryData.astigmiaOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput11" @keyup.native.enter="nextInput(12)" v-model="optometryData.glassColorOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput12" @keyup.native.enter="nextInput(13)" v-model="optometryData.specialDesignOs"></el-input></td>
        <td><el-input size="mini" class="table-input" ref="tableInput13" @keyup.native.enter="nextInput(14)" v-model="optometryData.brandOs"></el-input></td>
      </tr>
      <tr>
        <td>备注</td>
        <td colspan="9"><el-input size="mini" type="textarea" :rows="1" ref="tableInput14" @keyup.native.enter="nextInput(15)" v-model="optometryData.memo"></el-input></td>
      </tr>
    </table>
    <!-- 药品 -->
    <table v-if="optometryData.optType == 11" class="miui-table" bgcolor="#dfffdf">
      <tr>
        <td>备注</td>
        <td colspan="9"><el-input size="mini" type="textarea" :rows="1" v-model="optometryData.memo"></el-input></td>
      </tr>
    </table>
    </el-form>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  export default {
    props:['optometryData','saleType','source'],
    data () {
      var validAxesOd = (rule, value, callback) => {
        if(this.optometryData.postGlassOd && this.optometryData.postGlassOd != '0.00') {
          if(value === '' || value == undefined){
            callback(new Error('请输入右眼轴向'))
          }else{
            callback()
          }
        }else{
          callback()
        }
      };
      var validAxesOs = (rule, value, callback) => {
        if(this.optometryData.postGlassOs && this.optometryData.postGlassOs != '0.00') {
          if(value === '' || value == undefined){
            callback(new Error('请输入左眼轴向'))
          }else{
            callback()
          }
        }else{
          callback()
        }
      };
			var validPupilDistanceOd = (rule,value,callback) => {
        if(this.optometryData.optType == '1' || this.optometryData.optType == '5'){
          if(value === '' || value == undefined){
            callback(new Error('请输入左眼瞳距'))
          }else{
            callback()
          }
        }else if(this.optometryData.optType == '2'){
          if(value === '' || value == undefined){
            callback(new Error('请输入左眼瞳距'))
          }else{
            callback()
          }
        }else if(this.optometryData.optType == '4' || this.optometryData.optType == '7'){
          if(value === '' || value == undefined){
            callback(new Error('请输入左眼瞳距'))
          }else{
            callback()
          }
        }else{
          callback()
        }
			};
			var validPupilDistanceOs = (rule,value,callback) => {
        if(this.optometryData.optType == '1' || this.optometryData.optType == '5'){
          if(value === '' || value == undefined){
            callback(new Error('请输入右眼瞳距'))
          }else{
            callback()
          }
        }else if(this.optometryData.optType == '2'){
          if(value === '' || value == undefined){
            callback(new Error('请输入右眼瞳距'))
          }else{
            callback()
          }
        }else if(this.optometryData.optType == '4' || this.optometryData.optType == '7'){
          if(value === '' || value == undefined){
            callback(new Error('请输入右眼瞳距'))
          }else{
            callback()
          }
        }else{
          if(value === ''){
            callback(new Error('请输入右眼瞳距'))
          }else{
            callback()
          }
        }
			}
      return {
        dataRule: {
          ballGlassOd: [
            { required: true, message: '右眼球镜不能为空', trigger: 'change' },
            { pattern:/^((\-|\+)?([1-9]\d{0,1}|0))(\.[0-9](0|5))?$/, message: '请输入正确的格式', trigger: 'blur' }
          ],
          ballGlassOs: [
            { required: true, message: '左眼球镜不能为空', trigger: 'change' },
            { pattern:/^((\-|\+)?([1-9]\d{0,1}|0))(\.[0-9](0|5))?$/, message: '请输入正确的格式', trigger: 'blur' }
          ],
          postGlassOd: [
            { pattern:/^((\-|\+)?([1-9]\d{0,1}|0))(\.[0-9](0|5))?$/, message: '请输入正确的格式', trigger: 'blur' }
          ],
          postGlassOs: [
            { pattern:/^((\-|\+)?([1-9]\d{0,1}|0))(\.[0-9](0|5))?$/, message: '请输入正确的格式', trigger: 'blur' }
          ],
          axesOd: [
            { validator: validAxesOd, trigger: 'blur' }
          ],
          axesOs: [
            { validator: validAxesOs, trigger: 'blur' }
          ],
          farPupilDistanceOd: [{ validator: validPupilDistanceOd, trigger: 'blur' }],
          farPupilDistanceOs: [{ validator: validPupilDistanceOs, trigger: 'blur' }],
          nearPupilDistanceOd: [{ validator: validPupilDistanceOd, trigger: 'blur' }],
          nearPupilDistanceOs: [{ validator: validPupilDistanceOs, trigger: 'blur' }],
        }
      }
    },
    computed:{
      ...mapGetters(['bizData'])
    },
    methods:{
      nextInput(index) {
        if(this.$refs['tableInput' + index]){
          this.$refs['tableInput' + (index - 1)].blur()
          this.$refs['tableInput' + index].focus()
        }
      },
      //  检验验光数据
      checkOptometryData() {
        return this.$refs['dataForm']
      },
			axesOdChange(val) {
				if(parseFloat(val) < 0){
					this.optometryData.axesOd = 180 + parseFloat(val)
				}else if(parseFloat(val) > 180 && parseFloat(val) < 360){
					this.optometryData.axesOd = parseFloat(val) -180
				}else if(parseFloat(val) > 360){
					this.optometryData.axesOd = ''
					this.$message.warning('输入错误，请重新输入')
				}
			},
      axesOsChange(val) {
      	if(parseFloat(val) < 0){
      		this.optometryData.axesOs = 180 + parseFloat(val)
      	}else if(parseFloat(val) > 180 && parseFloat(val) < 360){
      		this.optometryData.axesOs = parseFloat(val) - 180
      	}else if(parseFloat(val) > 360){
      		this.optometryData.axesOs = ''
      		this.$message.warning('输入错误，请重新输入')
      	}
      },
      valueJudge(name){
        if(this.optometryData[name] < 0){
          this.optometryData[name] = ''
          this.$message.warning('输入错误，请重新输入')
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .miui-table {
    .table-input {
      // width: 50px;
    }
    .table-select {
      // width: 90px;
    }
    .width-145 {
      width: 145px;
    }
    .el-table--enable-row-hover .el-table__body tr:hover>td {
      background-color: #97baf6;
    }

    tr td,
    tr th {
      border: 2px solid #EFEEF5;
      text-align: center;
      padding: 3px 5px;
    }

    .colspan-td {
      text-align: left !important;
    }
  }
</style>
